//
// Created by zhulingfeng on 2020/2/6.
//

#ifndef BINARY_TREE_SRC_BINARY_TREE_TRAVERSAL_HPP_
#define BINARY_TREE_SRC_BINARY_TREE_TRAVERSAL_HPP_

#include "binary_tree_node.hpp"

#include <vector>

enum class BinaryTreeTraversalOrder { pre = 0, in, post, level };
void PreOrderTraversalRecursive(BinaryTreeNode *root, std::vector<int> &res);
void InOrderTraversalRecursive(BinaryTreeNode *root, std::vector<int> &res);
void PostOrderTraversalRecursive(BinaryTreeNode *root, std::vector<int> &res);
void BinaryTreeTraversalIterative(BinaryTreeNode *root,
                                  BinaryTreeTraversalOrder order,
                                  std::vector<int> &res);

void LevelOrderTraversalIterative(BinaryTreeNode *root, std::vector<int> &res);

std::vector<std::vector<int>> LevelOrderTraversal(BinaryTreeNode *root);

#endif  // BINARY_TREE_SRC_BINARY_TREE_TRAVERSAL_HPP_
